package tool

import play.api.data._
import play.api.data.Forms._
import tool.Pojo._

/**
 * Created by yz on 13/12/2021
 */
object FormTool {

  val keysForm = Form(
    mapping(
      "keys" -> list(text),
    )(KeysData.apply)(KeysData.unapply)
  )

  val rsNumberForm = Form(
    mapping(
      "rsNumber" -> text,
    )(RsNumberData.apply)(RsNumberData.unapply)
  )

  val rsNumberOpForm = Form(
    mapping(
      "rsNumber" -> optional(text),
    )(RsNumberOpData.apply)(RsNumberOpData.unapply)
  )

  val capsForm= Form(
    mapping(
      "method" -> text,
      "queryText" -> text,
      "reference" -> text,
      "ploidy" -> text,
      "caps" -> text,
      "kasp" -> text,
      "pickAnyway" -> text,
      "maxTm" -> text,
      "price" -> text,
      "maxSize" -> text
    )(CapsData.apply)(CapsData.unapply)
  )

}
